import type{ userStoreType } from "@/utils/type"
import type{ StateCreator } from 'zustand'; 

const info = {
  username:"",
  nickname:"",
}


export const userStore:StateCreator<userStoreType> =(set)=> (
  { 
    token:localStorage.getItem("token") || "",    
    info,
    setInfo: (info) => {
      set( { info } );
    },
    setToken: (token) => {
      set( { token } );
    }
  }
)